package com.ssy.lingxi.order.model.dto;

import java.io.Serializable;
import java.math.BigDecimal;
import java.util.Objects;

/**
 * 订单商品及关联的交易流程信息
 * @author 万宁
 * @version 2.0.0
 * @date 2021-09-07
 */
public class TradeProcessDetailDTO implements Serializable {
    private static final long serialVersionUID = -4690818071339740937L;

    public TradeProcessDetailDTO() {
    }

    public TradeProcessDetailDTO(String processKey, Integer payTimes, Long contractId, String payNodeString, BigDecimal expireHours) {
        this.processKey = processKey;
        this.payTimes = payTimes;
        this.contractId = contractId;
        this.payNodeString = payNodeString;
        this.expireHours = expireHours;
    }

    /**
     * 流程Key
     */
    private String processKey;

    /**
     * 支付次数
     */
    private Integer payTimes;

    /**
     * 电子合同Id，如不使用合同，为0
     */
    private Long contractId;

    /**
     * 支付环节名称.concat(支付次数）
     */
    private String payNodeString;

    /**
     * 订单取消时间
     */
    private BigDecimal expireHours;

    public String getProcessKey() {
        return processKey;
    }

    public void setProcessKey(String processKey) {
        this.processKey = processKey;
    }

    public Integer getPayTimes() {
        return payTimes;
    }

    public void setPayTimes(Integer payTimes) {
        this.payTimes = payTimes;
    }

    public Long getContractId() {
        return contractId;
    }

    public void setContractId(Long contractId) {
        this.contractId = contractId;
    }

    public String getPayNodeString() {
        return payNodeString;
    }

    public void setPayNodeString(String payNodeString) {
        this.payNodeString = payNodeString;
    }

    public BigDecimal getExpireHours() {
        return expireHours;
    }

    public void setExpireHours(BigDecimal expireHours) {
        this.expireHours = expireHours;
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) {
            return true;
        }

        if (o == null || getClass() != o.getClass()) {
            return false;
        }

        TradeProcessDetailDTO detailDTO = (TradeProcessDetailDTO) o;
        return processKey.equals(detailDTO.processKey) &&
                payTimes.equals(detailDTO.payTimes) &&
                contractId.equals(detailDTO.contractId) &&
                payNodeString.equals(detailDTO.payNodeString) &&
                expireHours.equals(detailDTO.expireHours);
    }

    @Override
    public int hashCode() {
        return Objects.hash(processKey, payTimes, contractId, payNodeString, expireHours);
    }
}
